//
//  VistaEditarPerfil.m
//  ProyectoMoviTiendas
//
//  Created by Mario Franco on 3/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "VistaEditarPerfil.h"

@interface VistaEditarPerfil ()

@end

@implementation VistaEditarPerfil
@synthesize txtNombre;
@synthesize txtDireccion;
@synthesize principal;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}



- (void)viewDidLoad
{
    self.navigationItem.hidesBackButton = YES;
    
    [super viewDidLoad];
    principal = [MoviTiendas darInstancia];
    
    txtNombre.text = principal.cliente.nombre;
    
    txtDireccion.text = principal.cliente.direccion1;
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [self setTxtNombre:nil];
    [self setTxtDireccion:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)modificarPerfil:(id)sender 
{
    
    
    MoviTiendas * moviTienda = [MoviTiendas darInstancia];
    
    [moviTienda modificarClienteConNombre:txtNombre.text 
                             conDireccion:txtDireccion.text 
                                conBarrio:moviTienda.cliente.barrio];
    [self.navigationController popViewControllerAnimated:YES];
}



@end
